package com.asia5b.a5mall.home.adapter

import com.asia5b.a5mall.home.R
import com.asia5b.a5mall.home.databinding.ItemSettingAdapterBinding
import com.asia5b.a5mall.middleware.model.bean.SettingItemBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder

/**
 * Created by zhangyuncai on 2019/12/21.
 */
class SettingItemAdapter(list: ArrayList<SettingItemBean>) :
        BaseQuickAdapter<SettingItemBean, BaseDataBindingHolder<ItemSettingAdapterBinding>>(R.layout.item_setting_adapter, list) {
    override fun convert(holder: BaseDataBindingHolder<ItemSettingAdapterBinding>, item: SettingItemBean) {
        holder.setIsRecyclable(false)
        val binding = holder.dataBinding!!
        binding.item = item
        holder.itemView.setOnClickListener {
            item.onClickListener?.onClick(it)
        }
    }
}